//修改地址行背景class
function backGroundColor1(e, index) {
    e.className = "thead-tbl-address address-default address-hover";
    $("a[Id='" + index + "']").show();
}
function backGroundColor2(e, index) {
    e.className = "thead-tbl-address address-default ";
    $("a[Id='" + index + "']").hide();
}
//修改地区下拉菜单颜色
function backDistrictColor1(e) {
    $('#' + e.id).css("color", "#fc6210");
}
function backDistrictColor2(e) {
    $('#' + e.id).css("color", "#000000");
}


//获取省份及城市
var provinces = province;
var citys;
var areas = area;
//获取城市
function getDistrictCity(addressCitys) {
    for (var i = 0; i < provinces.length; i++) {
        if (provinces[i]["id"] == addressCitys.id) {
            $('.city-title').html(provinces[i]["name"] + '<span id="downArrow"></span>');
            $('.J_iProvince').val(provinces[i]["name"]);
            citys = provinces[i]["city"]
            break;
        }
    }
    $("#newprovinces").attr('id', 'provinces');
    $(".provinces").hide();
    $(".citys").html('');
    $(".areas").html('');
    $(".J_iCity").val('');
    $(".J_iArea").val('');
    for (var i = 0; i < citys.length; i++) {
        $(".citys").html($(".citys").html() + '<a onclick="getDistrictArea1(this)" onmouseover = "backDistrictColor1(this)" onmouseout = "backDistrictColor2(this)" id=' + citys[i]["id"] + ' class="city">' + citys[i]["name"] + '</a>');
    }
    if (citys.length != 1) {
        $('#citys').attr('id', 'newcitys');
        $(".citys").show();
    } else {
        getDistrictArea2(citys[0]["id"]);
        $('#areas').attr('id', 'newareas');
        $(".areas").show();
    }
}
//获取县区
function getDistrictArea1(addressAreas) {
    getDistrictArea2(addressAreas.id)
}
//自动获取县区
function getDistrictArea2(addressAreasId) {
    var i;
    $(".areas").html('');
    $(".J_iArea").val('');
    for (i = 0; i < areas.length; i++) {
        if (areas[i]["pid"] == addressAreasId) {
            $(".areas").html($(".areas").html() + '<a onclick="getDistrict(this)" onmouseover = "backDistrictColor1(this)" onmouseout = "backDistrictColor2(this)" id=' + areas[i]["id"] + ' class="area">' + areas[i]["name"] + '</a>');
        }
    }
    for (j = 0; j < citys.length; j++) {
        if (citys[j]["id"] == addressAreasId) {
            $('.city-title').html($('.J_iProvince').val() + '<span id="spanColor"  style="color:#cfcfcf">/</span>' + citys[j]["name"] + '<span id="downArrow"></span>');
            $('.J_iCity').val(citys[j]["name"]);

        }
    }

    $("#newcitys").attr('id', 'citys');
    $(".citys").hide();
    $('#areas').attr('id', 'newareas');
    $(".areas").show();
}
//获得结果
function getDistrict(addressArea) {
    for (i = 0; i < areas.length; i++) {
        if (areas[i]["id"] == addressArea.id) {
            $('.city-title').html($('.J_iProvince').val() + '<span id="spanColor" style="color:#cfcfcf">/</span>' + $('.J_iCity').val() + '<span id="spanColortwo"  style="color:#cfcfcf">/</span>' + areas[i]["name"] + '<span id="downArrow"></span>');
            $('.J_iArea').val(areas[i]["name"]);
        }
    }
    $("#district").hide();
    $(".areas").hide();

}

//显示省
function showProvinces(addressArea) {
    $(".provinces").show();
    $(".citys").hide();
    $(".areas").hide();

    $("#provinces").attr('id', 'newprovinces');
    $("#newcitys").attr('id', 'citys');
    $('#newareas').attr('id', 'areas');
}
//显示城市
function showCitys(addressArea) {
    $(".provinces").hide();
    $(".citys").show();
    $(".areas").hide();

    $("#newprovinces").attr('id', 'provinces');
    $("#citys").attr('id', 'newcitys');
    $('#newareas').attr('id', 'areas');

}
//显示县区
function showAreas(addressArea) {
    $(".provinces").hide();
    $(".citys").hide();
    $(".areas").show();

    $("#newprovinces").attr('id', 'provinces');
    $("#newcitys").attr('id', 'citys');
    $('#areas').attr('id', 'newareas');
}

function selectDistrict() {
    $("#district").show();
    $(".provinces").show();
    $(".citys").hide();
    $(".areas").hide();

    $("#provinces").attr('id', 'newprovinces');
    $("#newcitys").attr('id', 'citys');
    $('#newareas').attr('id', 'areas');
}

//初始化页面,及自动验证表单功能
window.onload = function () {
    document.onclick = function (e) {
        e = e || window.event;
        var dom = e.srcElement || e.target;
        if (dom.id == "" || dom.id == null || dom.id == "address" || dom.id == "consigneePhone" || dom.id == "delFlag") {
            $('#district').hide();
        }

        if ($("#consigneeError").text() == null || $("#consigneeError").text() == "") {
            $('.consigneeError').hide();
        }else if (dom.id == "consignee") {
            $('.consigneeError').show();
        }
        if ($("#consigneePhoneError").text() == null || $("#consigneePhoneError").text() == "") {
            $('.consigneePhoneError').hide();
        }else if (dom.id == "consigneePhone") {
            $('.consigneePhoneError').show();
        }
        if ($("#postalcodeError").text() == null || $("#postalcodeError").text() == "") {
            $('.postalcodeError').hide();
        }else if (dom.id == "consigneePostalcode") {
            $('.postalcodeError').show();
        }
        if ($("#consigneePostalcode").val() != ""&&$("#consigneePostalcode").val() != null) {
            $('.postalcodeError').hide();
        }else if (dom.id == "consigneePostalcode") {
            $('.postalcodeError').show();
        }
        if ($("#addressError").text() == null || $("#addressError").text() == "") {
            $('.addressError').hide();
        }else if (dom.id == "address") {
            $('.addressError').show();
        }


        //地区下拉框高度
        if ($('.tbl-deliver-main').css("height").split("px")[0] < 400) {
            $('.tbl-deliver-main').css("height", "auto");
        } else {
            $('.tbl-deliver-main').css("height", "400px");
        }
    };
    $(".hide").hide();
    $(".form-validates").hide();
    //初期的判断
    if ($('#amount').html() == "0") {
        $(".tbl-main").hide();
        $('#amount').hide();
        $(".caption").html(getMessage("MSG1101", []));
    } else {
        var index = $('#amount').text();
        $(".caption").html(getMessage("MSG1109", ['<span id="amount">' + index + '</span>']));
    }
    //地区下拉框高度
    if ($('.tbl-deliver-main').css("height").split("px")[0] < 400) {
        $('.tbl-deliver-main').css("height", "auto");
    } else {
        $('.tbl-deliver-main').css("height", "400px");
    }
    $(".provinceCharteredCities").html('');
    $(".provinceAH").html('');
    $(".provinceJZ").html('');
    $(".provinceAutonomy").html('');
    $(".provinceGAT").html('');

    //初期添加省
    for (var i = 0; i < 4; i++) {
        $(".provinceCharteredCities").html($(".provinceCharteredCities").html() + '<a onclick="getDistrictCity(this)" onmouseover = "backDistrictColor1(this)" onmouseout = "backDistrictColor2(this)" id=' + provinces[i]["id"] + ' class= "province" > ' + provinces[i]["name"] + '</a>');
    }
    for (var i = 4; i < 15; i++) {
        $(".provinceAH").html($(".provinceAH").html() + '<a onclick="getDistrictCity(this)" onmouseover = "backDistrictColor1(this)" onmouseout = "backDistrictColor2(this)" id=' + provinces[i]["id"] + ' class="province">' + provinces[i]["name"] + '</a>');
    }
    for (var i = 15; i < 26; i++) {
        $(".provinceJZ").html($(".provinceJZ").html() + '<a onclick="getDistrictCity(this)" onmouseover = "backDistrictColor1(this)" onmouseout = "backDistrictColor2(this)" id=' + provinces[i]["id"] + ' class="province">' + provinces[i]["name"] + '</a>');
    }
    for (var i = 26; i < 31; i++) {
        $(".provinceAutonomy").html($(".provinceAutonomy").html() + '<a onclick="getDistrictCity(this)" onmouseover = "backDistrictColor1(this)" onmouseout = "backDistrictColor2(this)" id=' + provinces[i]["id"] + ' class="province">' + provinces[i]["name"] + '</a>');
    }
    for (var i = 31; i < provinces.length; i++) {
        $(".provinceGAT").html($(".provinceGAT").html() + '<a onclick="getDistrictCity(this)" onmouseover = "backDistrictColor1(this)" onmouseout = "backDistrictColor2(this)" id=' + provinces[i]["id"] + ' class="province">' + provinces[i]["name"] + '</a>');
    }

    // 手机号验证
    $("#consigneePhone").change(function () {
        if ($('#consigneePhone').val().length == 0) {
            $('#consigneePhoneError').text(getMessage("MSG1102", []));
            $('#consigneePhoneError').css("color", "#ff0000");
            //$('.consigneePhoneError').show();
            $(".consigneePhoneError .hint").hide();
            $(".consigneePhoneError .error").show();
        } else if (!/^1[0-9]{10}$/.test($('#consigneePhone').val())) {
            $('#consigneePhoneError').text(getMessage("MSG1103", []));
            $('#consigneePhoneError').css("color", "#ff0000");
            //$('.consigneePhoneError').show();
            $(".consigneePhoneError .hint").hide();
            $(".consigneePhoneError .error").show();
        } else {
            $('#consigneePhoneError').text("");
            $('.consigneePhoneError').hide();
        }
    });

    // 收货人姓名验证
    $("#consignee").change(function () {
        if ($("#consignee").val().length == 0) {
            $('#consigneeError').text(getMessage("MSG1104", []));
            $('#consigneeError').css("color", "#ff0000");
            //$('.consigneeError').show();
            $(".consigneeError .hint").hide();
            $(".consigneeError .error").show();
        } else if ($("#consignee").val().length > 26) {
            $('#consigneeError').text(getMessage("MSG1105", []));
            $('#consigneeError').css("color", "#ff0000");
            //$('.consigneeError').show();
            $(".consigneeError .hint").hide();
            $(".consigneeError .error").show();
        } else {
            $('#consigneeError').text("");
            $('.consigneeError').hide();
        }
    });

    // 所在地区验证
    $(".J_iArea").change(function () {
        if ($(".J_iArea").val().length == 0) {
            $('#districtError').text(getMessage("MSG1106", []));
            $('#districtError').css("color", "#ff0000");
            //$('.districtError').show();
            $(".districtError .hint").hide();
            $(".districtError .error").show();
        } else {
            $('#districtError').text("");
            $('.districtError').hide();
        }
    });
    // 详细地址验证
    $("#address").change(function () {
        if ($("#address").val().length > 121 || $("#address").val().length < 6) {
            $('#addressError').text(getMessage("MSG1107", []));
            $('#addressError').css("color", "#ff0000");
            //$('.addressError').show();
            $(".addressError .hint").hide();
            $(".addressError .error").show();
        } else {
            $('#addressError').text("");
            $('.addressError').hide();
        }
    });

}
//新增地址信息按钮
function emptyAddress() {
    $('#addressidOne').val('');
    $('#consignee').val('');
    $('#consigneePhone').val('');
    $('.J_iProvince').val('');
    $('.J_iCity').val('');
    $('.J_iArea').val('');
    $('#consigneePostalcode').val('');
    $('#address').val('');
    $('.city-title').text('');
    $("#delFlag").html('<div style="margin-right: 40px;position: relative; top: -50px"><input style="zoom: 130%;position: relative; top: 3px" type="checkbox" name="delFlag"/><span th:text="#{addressHtml.addDefault}">设为默认收货地址</span></div>')
}
//提交按钮
function commitFn() {

    //input各种判断
    if (!itemAllValid()) {
        var event = event || window.event;
        event.preventDefault(); // 兼容标准浏览器
        window.event.returnValue = false; // 兼容IE6~8
    } else {
        alert(getMessage("MSG1108", []));
    }
}


//验证方法
function itemAllValid() {
    var error = true;
    // 手机号
    if ($('#consigneePhone').val().length == 0) {
        $('#consigneePhoneError').text(getMessage("MSG1102", []));
        $('#consigneePhoneError').css("color", "#ff0000");
        $('.consigneePhoneError').show();
        $(".consigneePhoneError .hint").hide();
        $(".consigneePhoneError .error").show();
        error = false;
    } else if (!/^1[0-9]{10}$/.test($('#consigneePhone').val())) {
        $('#consigneePhoneError').text(getMessage("MSG1103", []));
        $('#consigneePhoneError').css("color", "#ff0000");
        $('.consigneePhoneError').show();
        $(".consigneePhoneError .hint").hide();
        $(".consigneePhoneError .error").show();
        error = false;
    } else {
        $('#consigneePhoneError').text("");
        $('.consigneePhoneError').hide();
    }
    //收货人姓名
    if ($("#consignee").val().length == 0) {
        $('#consigneeError').text(getMessage("MSG1104", []));
        $('#consigneeError').css("color", "#ff0000");
        $('.consigneeError').show();
        $(".consigneeError .hint").hide();
        $(".consigneeError .error").show();
        error = false;
    } else if ($("#consignee").val().length > 26) {
        $('#consigneeError').text(getMessage("MSG1105", []));
        $('#consigneeError').css("color", "#ff0000");
        $('.consigneeError').show();
        $(".consigneeError .hint").hide();
        $(".consigneeError .error").show();
        error = false;
    } else {
        $('#consigneeError').text("");
        $('.consigneeError').hide();
    }
    //所在地区
    if ($(".J_iArea").val().length == 0) {
        $('#districtError').text(getMessage("MSG1106", []));
        $('#districtError').css("color", "#ff0000");
        $('.districtError').show();
        $(".districtError .hint").hide();
        $(".districtError .error").show();
        error = false;
    } else {
        $('#districtError').text("");
        $('.districtError').hide();
    }
    //详细地址
    if ($("#address").val().length > 121 || $("#address").val().length < 6) {
        $('#addressError').text(getMessage("MSG1107", []));
        $('#addressError').css("color", "#ff0000");
        $('.addressError').show();
        $(".addressError .hint").hide();
        $(".addressError .error").show();
        error = false;
    } else {
        $('#addressError').text("");
        $('.addressError').hide();
    }

    return error;
}
//修改数据显示点击事件
function updateAddress(e) {
    $.ajax({
        //提交数据的类型 POST GET
        type: "POST",
        //提交的网址
        url: "/address/updateAddress",

        //提交的数据
        data: {
            addressid: e.id
        },
        //返回数据的格式
        datatype: "json",//"xml", "html", "script", "json", "jsonp", "text".
        //在请求之前调用的函数
        beforeSend: function () {
        }

        ,
        //成功返回之后调用的函数
        success: function (data) {
            $("#addressidOne").val(data["Address"].addressid);
            $("#consignee").val(data["Address"].consignee);
            $("#consigneePhone").val(data["Address"].telPhone);
            $(".J_iProvince").val(data["districts"][0]);
            $(".J_iCity").val(data["districts"][1]);
            $(".J_iArea").val(data["districts"][2]);
            $('.city-title').html($('.J_iProvince').val() + '<span id="spanColor" style="color:#cfcfcf">/</span>' + $('.J_iCity').val() + '<span  id="spanColortwo" style="color:#cfcfcf">/</span>' + $('.J_iArea').val() + '<span id="downArrow"></span>');
            $("#consigneePostalcode").val(data["Address"].postalcode);
            $("#address").val(data["Address"].address);
            if (data["Address"].delFlag == 1) {
                $("#delFlag").html('<div style="margin-right: 40px;position: relative; top: -50px"><input checked="checked" style="zoom: 130%;position: relative; top: 3px" type="checkbox" name="delFlag"/><span th:text="#{addressHtml.addDefault}">设为默认收货地址</span></div>')
            } else {
                $("#delFlag").checked = "";
                $("#delFlag").html('<div style="margin-right: 40px;position: relative; top: -50px"><input style="zoom: 130%; position: relative; top: 3px" type="checkbox" name="delFlag"/><span th:text="#{addressHtml.addDefault}">设为默认收货地址</span></div>')}
            for (var i = 0; i < provinces.length; i++) {
                if (provinces[i]["name"] == $(".J_iProvince").val()) {
                    citys = provinces[i]["city"];
                    break;
                }
            }
            for (var i = 0; i < citys.length; i++) {
                $(".citys").html($(".citys").html() + '<a onclick="getDistrictArea1(this)" onmouseover = "backDistrictColor1(this)" onmouseout = "backDistrictColor2(this)" id=' + citys[i]["id"] + ' class="city">' + citys[i]["name"] + '</a>');
            }
            for (var i = 0; i < citys.length; i++) {
                if (citys[i]["name"] == $(".J_iCity").val()) {
                    var citysId = citys[i]["id"];
                    break;
                }
            }
            for (var i = 0; i < areas.length; i++) {
                if (areas[i]["pid"] == citysId) {
                    $(".areas").html($(".areas").html() + '<a onclick="getDistrict(this)" onmouseover = "backDistrictColor1(this)" onmouseout = "backDistrictColor2(this)" id=' + areas[i]["id"] + ' class="area">' + areas[i]["name"] + '</a>');
                }
            }
            $(".form-validates").hide();
            $(".hide").hide();
            $("#consignee").focus();
        }
        ,
        //调用出错执行的函数
        error: function () {
            alert("异常");
            // 校验失败

        }
    })
    ;
}

//删除数据点击事件
function deleteAddress(e) {
    $.ajax({
        //提交数据的类型 POST GET
        type: "POST",
        //提交的网址
        url: "/address/deleteAddress",

        //提交的数据
        data: {
            addressid: e.id
        },
        //返回数据的格式
        datatype: "text",//"xml", "html", "script", "json", "jsonp", "text".
        //在请求之前调用的函数
        beforeSend: function () {
        },
        //成功返回之后调用的函数
        success: function (data) {
            var addressList = data["addressList"];
            $("#amount").text(addressList.length);
            $("#tbl-main").html("");
            for (var v = 0; v < addressList.length; v++) {
                if (addressList[v].delFlag == 0) {
                    $("#tbl-main").html($("#tbl-main").html() + '<tr id = "' + addressList[v].addressid + '" onmouseover = "backGroundColor1(this,' + v + ')" onmouseout = "backGroundColor2(this,' + v + ')" class = "thead-tbl-address address-default " > <div hidden = "hidden" > <input id = "addressid" value = "' + addressList[v].addressid + '" hidden = "hidden" /><input id = "userid" value = "' + addressList[v].operaid + '" hidden = "hidden" /></div><td style = "width: 40px;text-align: center">' + (v + 1) + ' </td><td style = "width: 68px" >' + addressList[v].consignee + '</td><td style = "width: 136px" >' + addressList[v].district + '</td><td style = "width: 136px" >' + addressList[v].address + '</td><td style = "width: 68px" >' + addressList[v].postalcode + '</td><td style = "width: 87px">' + addressList[v].telPhone + '</td><td style = "width: 68px" ><a href="#J_DeliverTitle" id = "' + addressList[v].addressid + '" onclick = "updateAddress(this)" class = "operationAddress" > 修改 </a> | <a id = "' + addressList[v].addressid + '" onclick = "deleteAddress(this)" class = "del operationAddress" > 删除 </a></td><td style = "width: 60px" class = "thead-tbl-status" ><a id = "' + v + '" class = "implicit hide"  name="' + addressList[v].addressid + '" onclick="delFlagAddress(this)"> 设为默认 </a></td></tr>');
                } else {
                    $("#tbl-main").html('<tr id = "' + addressList[v].addressid + '" onmouseover = "backGroundColor1(this,' + v + ')" onmouseout = "backGroundColor2(this,' + v + ')" class = "thead-tbl-address address-default " > <div hidden = "hidden"> <input id = "addressid" value = "' + addressList[v].addressid + '" hidden = "hidden" /><input id = "userid" value = "' + addressList[v].operaid + '" hidden = "hidden" /></div><td style = "width: 40px;text-align: center" >' + (v + 1) + '</td><td style = "width: 68px" >' + addressList[v].consignee + '</td><td style = "width: 136px">' + addressList[v].district + '</td><td style = "width: 136px" >' + addressList[v].address + '</td><td style = "width: 68px" >' + addressList[v].postalcode + '</td><td style = "width: 87px" >' + addressList[v].telPhone + '</td><td style = "width: 68px" ><a href="#J_DeliverTitle" id = "' + addressList[v].addressid + '" onclick = "updateAddress(this)" class = "operationAddress" > 修改 </a> | <a id = "' + addressList[v].addressid + '" onclick = "deleteAddress(this)" class = "del operationAddress" > 删除 </a></td><td style = "width: 60px" class = "thead-tbl-status" ><span class = "note"> 默认地址 </span></td></tr>');
                }
            }
            //初期的判断
            if (addressList.length == 0) {
                $(".tbl-main").hide();
                $('#amount').hide();
                $(".caption").html(getMessage("MSG1101", []));
            } else {
                var index = $('#amount').text();
                $(".caption").html(getMessage("MSG1109", ['<span id="amount">' + (index) + '</span>']));
            }
            //隐藏hide数据
            $(".hide").hide();
            //调整地址显示框高度
            if ($('.tbl-deliver-main').css("height").split("px")[0] < 600) {
                $('.tbl-deliver-main').css("height", "auto");
            } else {
                $('.tbl-deliver-main').css("height", "600px");
            }
        },
        //调用出错执行的函数
        error: function () {
            // 校验失败

        }
    });
}
//设为默认点击事件
function delFlagAddress(e) {
    $.ajax({
        //提交数据的类型 POST GET
        type: "POST",
        //提交的网址
        url: "/address/delFlagAddress",

        //提交的数据
        data: {
            addressid: e.name
        },
        //返回数据的格式
        datatype: "text",//"xml", "html", "script", "json", "jsonp", "text".
        //在请求之前调用的函数
        beforeSend: function () {
        },
        //成功返回之后调用的函数
        success: function (data) {
            var addressList = data["addressList"];
            for (var v = 0; v < addressList.length; v++) {
                if (addressList[v].delFlag == 0) {
                    $("#tbl-main").html($("#tbl-main").html() + '<tr id = "' + addressList[v].addressid + '" onmouseover = "backGroundColor1(this,' + v + ')" onmouseout = "backGroundColor2(this,' + v + ')" class = "thead-tbl-address address-default " > <div hidden = "hidden" > <input id = "addressid" value = "' + addressList[v].addressid + '" hidden = "hidden" /><input id = "userid" value = "' + addressList[v].operaid + '" hidden = "hidden" /></div><td style = "width: 40px;text-align: center">' + (v + 1) + ' </td><td style = "width: 68px" >' + addressList[v].consignee + '</td><td style = "width: 136px" >' + addressList[v].district + '</td><td style = "width: 136px" >' + addressList[v].address + '</td><td style = "width: 68px" >' + addressList[v].postalcode + '</td><td style = "width: 87px">' + addressList[v].telPhone + '</td><td style = "width: 68px" ><a href="#J_DeliverTitle" id = "' + addressList[v].addressid + '" onclick = "updateAddress(this)" class = "operationAddress" > 修改 </a> | <a id = "' + addressList[v].addressid + '" onclick = "deleteAddress(this)" class = "del operationAddress" > 删除 </a></td><td style = "width: 60px" class = "thead-tbl-status" ><a id = "' + v + '" class = "implicit hide"  name="' + addressList[v].addressid + '" onclick="delFlagAddress(this)"> 设为默认 </a></td></tr>');
                } else {
                    $("#tbl-main").html('<tr id = "' + addressList[v].addressid + '" onmouseover = "backGroundColor1(this,' + v + ')" onmouseout = "backGroundColor2(this,' + v + ')" class = "thead-tbl-address address-default " > <div hidden = "hidden"> <input id = "addressid" value = "' + addressList[v].addressid + '" hidden = "hidden" /><input id = "userid" value = "' + addressList[v].operaid + '" hidden = "hidden" /></div><td style = "width: 40px;text-align: center" >' + (v + 1) + '</td><td style = "width: 68px" >' + addressList[v].consignee + '</td><td style = "width: 136px">' + addressList[v].district + '</td><td style = "width: 136px" >' + addressList[v].address + '</td><td style = "width: 68px" >' + addressList[v].postalcode + '</td><td style = "width: 87px" >' + addressList[v].telPhone + '</td><td style = "width: 68px" ><a href="#J_DeliverTitle" id = "' + addressList[v].addressid + '" onclick = "updateAddress(this)" class = "operationAddress" > 修改 </a> | <a id = "' + addressList[v].addressid + '" onclick = "deleteAddress(this)" class = "del operationAddress" > 删除 </a></td><td style = "width: 60px" class = "thead-tbl-status" ><span class = "note"> 默认地址 </span></td></tr>');
                }
            }
            $(".hide").hide();

        },
        //调用出错执行的函数
        error: function () {
            // 校验失败

        }
    });
}

